package cn.ryh.listener.annotation;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 * @ClassName AnnotationServletContextListener
 * @Description 使用@WebListener注解注册，实现ServletContextListener接口，监听ServletContext的创建与销毁
 * @Author RaoYH
 */
@WebListener
public class AnnotationServletContextListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent sce) {

        System.out.println("AnnotationServletContextListener 初始化");
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {

        System.out.println("AnnotationServletContextListener 销毁");
    }
}
